using System;
using System.Collections.Generic;
using UMC.Data;
namespace UMC.ITME.Entities
{
    public partial class Firewall
    {
        readonly static Action<Firewall, object>[] _SetValues = new Action<Firewall, object>[] { (r, t) => r.AuthType = Reflection.ParseObject(t, r.AuthType), (r, t) => r.Caption = Reflection.ParseObject(t, r.Caption), (r, t) => r.Expire = Reflection.ParseObject(t, r.Expire), (r, t) => r.Fingerprint = Reflection.ParseObject(t, r.Fingerprint), (r, t) => r.Type = Reflection.ParseObject(t, r.Type) };
        readonly static string[] _Columns = new string[] { "AuthType", "Caption", "Expire", "Fingerprint", "Type" };
        protected override void SetValue(string name, object obv)
        {
            var index = Utility.Search(_Columns, name, StringComparer.CurrentCultureIgnoreCase);
            if (index > -1) _SetValues[index](this, obv);
        }
        protected override void GetValues(Action<String, object> action)
        {
            AppendValue(action, "AuthType", this.AuthType);
            AppendValue(action, "Caption", this.Caption);
            AppendValue(action, "Expire", this.Expire);
            AppendValue(action, "Fingerprint", this.Fingerprint);
            AppendValue(action, "Type", this.Type);
        }

        protected override RecordColumn[] GetColumns()
        {
            var cols = new RecordColumn[5];
            cols[0] = RecordColumn.Column("AuthType", this.AuthType);
            cols[1] = RecordColumn.Column("Caption", this.Caption);
            cols[2] = RecordColumn.Column("Expire", this.Expire);
            cols[3] = RecordColumn.Column("Fingerprint", this.Fingerprint);
            cols[4] = RecordColumn.Column("Type", this.Type);
            return cols;
        }

    }
}
